package com.aaa.controller;

import com.aaa.entity.Dispose;
import com.aaa.service.impl.DisposeServiceImpl;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName: MenuController
 * @Description: TODO
 * @Author: 86139
 * @Date: 2021/9/3 22:41
 * @Version:1.0
 **/
@RestController
@RequestMapping("dispose")
public class DisposeController {
    @Resource
    DisposeServiceImpl disposeService;

@RequestMapping("select")
@ResponseBody
public List<Dispose> select()
{
    //serviceImpl实现的方法
    return disposeService.list();
}
    @RequestMapping("add")
    @ResponseBody
    public void add(Dispose dispose)
    {
        disposeService.save(dispose);
    }
    @RequestMapping("update")
    @ResponseBody
    public void update(Dispose dispose)
    {
        disposeService.updateById(dispose);
    }

    @RequestMapping("delete")
    @ResponseBody
    public void delete(Integer d_id)
    {
        disposeService.removeById(d_id);
    }
}
